<!DOCTYPE html>
<html>

<head>
    <title>价格账套管理</title>
    <#include "/header.html">
</head>

<body>
<div id="app" v-cloak>
    <!--查询-->
        <el-form :inline="true" v-model="q" size="small">
            <el-form-item>
                <el-input v-model.trim="q.favouredName" placeholder="账套名称"></el-input>
            </el-form-item>
            <el-button type="primary" size="small" icon="el-icon-search" @click="search"></el-button>
            <el-button type="primary" size="small" @click="rest">重置</el-button>
            <el-button type="primary" size="small" @click="add">新增</el-button>
        </el-form>
        <!--表格-->
        <el-table ref="tableData" :data="tableData" border highlight-current-row class="tb-edit" :default-sort="{prop: 'sid', order: 'ascending'}" @selection-change="handleSelectionChange" @row-click="handleclick" size="small">
            <el-table-column type="index" label="序号"></el-table-column>
            <el-table-column prop="favouredName" label="账套名称">
                <template slot-scope="scope">
                    <el-button type="text" size="small" @click="showDetail(scope.row)">{{scope.row.favouredName}}</el-button>
                </template>
            </el-table-column>
            <el-table-column prop="discountRate" label="折扣率"></el-table-column>
            <el-table-column prop="describes" label="描述"></el-table-column>
            <el-table-column prop="startTime" label="开始时间"></el-table-column>
            <el-table-column prop="endTime" label="结束时间"></el-table-column>
            <el-table-column label="操作">
                <template scope="scope">
                    <el-button size="small" type="primary" @click="update(scope.$index, scope.row)">编辑</el-button>
                    <el-button size="small" type="danger" @click="del(scope.$index, scope.row)">删除</el-button>
                </template>
            </el-table-column>
        </el-table>
        <div align="center">
            <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
             :page-sizes="[20, 50, 80, 100]" :page-size="pagesize"  layout="total, sizes, prev, pager, next, jumper" :total="totalCount" background>
            </el-pagination>
        </div>

    <!--弹框-->
    <el-dialog :title="title" :visible.sync="dialogFormVisible" width="25%">
        <el-form :label-position="labelPosition" label-width="80px" :model="storeFavouredPrice" ref="ruleForm" size="small">
            <el-row>
                <el-col :span="20" :offset="1"><div class="grid-content bg-purple-dark">
                    <el-form-item label="账套名称"  prop="favouredName" :rules="[{ required: true, message: '请输入账套名称', trigger: 'blur' }]">
                        <el-input v-model.trim="storeFavouredPrice.favouredName" style="width: 200px" :readonly="title=='详情'" placeholder="账套名称"></el-input>
                    </el-form-item>
                    <el-form-item label="折扣率" prop="discountRate" :rules="[{ required: true, message: '请输入折扣率,有效范围0-1之间', trigger: 'blur' }]">
                        <el-input-number step="0.1" min="0" max="1" v-model.trim.number="storeFavouredPrice.discountRate" style="width: 200px" :readonly="title=='详情'" placeholder="有效范围0-1之间"></el-input-number>
                    </el-form-item>
                    <el-form-item label="描述" prop="describes" :rules="[{ required: true, message: '请输入描述', trigger: 'blur' }]">
                        <el-input v-model.trim="storeFavouredPrice.describes" style="width: 200px" :readonly="title=='详情'" placeholder="描述"></el-input>
                    </el-form-item>
                    <el-form-item label="开始时间" prop="startTime" :rules="[{ required: true, message: '请输入开始时间', trigger: 'blur' }]">
                        <el-date-picker v-model="storeFavouredPrice.startTime" style="width: 200px" type="datetime" placeholder="选择日期时间" :readonly="title=='详情'"></el-date-picker>
                    </el-form-item>
                    <el-form-item label="结束时间" prop="endTime" :rules="[{ required: true, message: '请输入结束时间', trigger: 'blur' }]">
                        <el-date-picker v-model="storeFavouredPrice.endTime" style="width: 200px" type="datetime" placeholder="选择日期时间" :readonly="title=='详情'"></el-date-picker>
                    </el-form-item>
                </div></el-col>
            </el-row>
        </el-form>

        <!--<el-form :inline="true" label-width="80px" :model="storeFavouredPrice" ref="ruleForm" :label-position="labelPosition" algin="center">-->
            <!--<el-row>-->
                <!--<el-col :span="8" :offset="8">-->
                    <!--<el-form-item label="账套名称" prop="favouredName" :rules="[{ required: true, message: '请输入账套名称', trigger: 'blur' }]">-->
                        <!--<el-input v-model.trim="storeFavouredPrice.favouredName" :readonly="title=='详情'" placeholder="账套名称"></el-input>-->
                    <!--</el-form-item>-->
                <!--</el-col>-->
            <!--</el-row>-->
            <!--<el-row>-->
                <!--<el-col :span="8" :offset="8">-->
                    <!--<el-form-item label="折扣率" prop="discountRate" :rules="[{ required: true, message: '请输入折扣率,有效范围0-1之间', trigger: 'blur' }]">-->
                        <!--<el-input-number v-model.trim.number="storeFavouredPrice.discountRate" :readonly="title=='详情'" placeholder="有效范围0-1之间"></el-input-number>-->
                    <!--</el-form-item>-->
                <!--</el-col>-->
            <!--</el-row>-->
            <!--<el-row>-->
                <!--<el-col :span="8" :offset="8">-->
                    <!--<el-form-item label="描述" prop="describes" :rules="[{ required: true, message: '请输入描述', trigger: 'blur' }]">-->
                        <!--<el-input v-model.trim="storeFavouredPrice.describes" :readonly="title=='详情'" placeholder="描述"></el-input>-->
                    <!--</el-form-item>-->
                <!--</el-col>-->
            <!--</el-row>-->
            <!--<el-row>-->
                <!--<el-col :span="8" :offset="8">-->
                    <!--<el-form-item label="开始时间" prop="startTime" :rules="[{ required: true, message: '请输入开始时间', trigger: 'blur' }]">-->
                        <!--<el-date-picker v-model="storeFavouredPrice.startTime" type="datetime" placeholder="选择日期时间" :readonly="title=='详情'"></el-date-picker>-->
                    <!--</el-form-item>-->
                <!--</el-col>-->
            <!--</el-row>-->
            <!--<el-row>-->
                <!--<el-col :span="8" :offset="8">-->
                    <!--<el-form-item label="结束时间" prop="endTime" :rules="[{ required: true, message: '请输入结束时间', trigger: 'blur' }]">-->
                        <!--<el-date-picker v-model="storeFavouredPrice.endTime" type="datetime" placeholder="选择日期时间" :readonly="title=='详情'"></el-date-picker>-->
                    <!--</el-form-item>-->
                <!--</el-col>-->
            <!--</el-row>-->
        <!--</el-form>-->
        <div slot="footer" class="dialog-footer">
            <el-button type="primary" size="small" @click="saveOrUpdate('ruleForm')" v-show="title!='详情'">确定</el-button>
            <el-button type="primary" size="small" @click="dialogFormVisible=!dialogFormVisible,$refs.ruleForm.resetFields()">取消</el-button>
        </div>
    </el-dialog>
</div>


<script src="${request.contextPath}/statics/js/modules/storeMember/twbStoreFavouredPrice.js?_${.now?long}"></script>
</body>
</html>